package com.zb.controller;

import com.zb.bean.Admin;
import com.zb.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin")
//允许跨域
@CrossOrigin
public class AdminController {

    //依赖注入
    @Autowired
    AdminService adminService;

    @RequestMapping("list")
    public List<Admin> getList(){
        List<Admin> list = adminService.list();
        return list;
    }
}
